<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
   %>
<script src="<%=basePath%>JS/ClassesInformation.js"></script>
<!--  从后台传过来的数据-->
<div class="none">
	<div id="currentPage">${page}</div>
	<div id="totalPages">${totoalPage}</div>
	<div id="currentCocourseCode">${cocourseCode}</div>
</div>
<!-- 页面内容 -->
<div class="Box" style="margin-top:15px;"  >
     <!-- 内容标题 -->
	<div class="Box-head Border" style="padding-left:25px;" >
		<label class="Labelstyle">班级信息管理</label>
	</div>
	<!-- 具体内容 -->
	<div class="Box-content"  style="padding:25px;">
		<!--  显示的选择菜单-->
		<div class="funxtion Box-head Border " style="padding-top:20px;padding-bottom:20px;margin-bottom:10px;">
			<div class="span3 offset1 ">
				<select id="courseName" class="">
				   <option value='0'>不限</option>
					<c:forEach var="coName" items="${courseName}">
						<option value=${coName.cocourseCode}>${coName.coname}</option>
					</c:forEach>
				</select>
			</div>
			<div class="span2 offset1">
			<input type="button" class="btn btn-info"  id="selsect" value="查询">
			</div>
		</div>
		<table class="table table-hover table-striped table-bordered">

			<thead>
				<tr>
				    <th width="25%">班级名</th>
					<th width="15%">教师名</th>
					<th width="20%">课程名称</th>
					<th width="20%">课程代码</th>
					<th width="20%">编辑</th>
				</tr>
			</thead>
			<tbody>
				<c:forEach var="classIn" items="${classinfo}">
					<tr>
						<td>${classIn.cname}</td>
						<td>${classIn.cteacher}</td>
						<td>${classIn.course.coname}</td>
						<td>${classIn.course.cocourseCode }</td>
                        <td><input type="button" data-toggle="modal" data-target="#changeClass" data-id=${classIn.cid} class="btn btn-info changeClass" value="编辑">
                        <input type="button" class="btn btn-warning delete" data-id=${classIn.cid}   value="删除">
                        </td>
					</tr>
				</c:forEach>
			</tbody>
		</table>
		<div id="example" class="center"></div><!--  分页按钮的显示-->
		<div class="funxtion Box-head Border " style="padding-top:20px;padding-bottom:20px;margin-bottom:10px;">
			<div class="span4 offset1">
				<a href="#insertClass" role="button"  class="btn btn-info" data-toggle="modal">新增班级</a>
		    </div>
	    </div>
    </div>
</div>

<!-- 修改班级信息 -->
<div id="changeClass" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
    <h3 id="myModalLabel">班级</h3>
  </div>
  <div class="modal-body">
  <form class="form-horizontal">
			<div class="control-group">
				<label class="control-label" for="oldPassword" >班级名</label>
				<div class="controls">
					<input type="text"  data-id="" id="changeName" placeholder="班级名">
				</div>
			</div>
			<div class="control-group">
				<label class="control-label" for="Password">教师名</label>
				<div class="controls">
					<input type="text" id="changeTeacher" placeholder="教师名">
				</div>
			</div>
			<div class="control-group">
				<label class="control-label" for="inputPassword">课程代码</label>
				<div class="controls">
				<select id="chengeCocourseCode" class="courseName">
				   <option value='0'>不限</option>
					<c:forEach var="coName" items="${courseName}">
						<option value=${coName.cocourseCode}>${coName.coname}</option>
					</c:forEach>
				</select>
				</div>
			</div>
		</form>
  </div>
  <div class="modal-footer">
    <button class="btn" data-dismiss="modal" aria-hidden="true">关闭</button>
    <button class="btn btn-primary" id="changeClass_btn">Save changes</button>
  </div>
</div>
<!-- 新增班级信息 -->
<div id="insertClass" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
    <h3 id="myModalLabel">学生信息</h3>
  </div>
  <div class="modal-body">
  <form class="form-horizontal">
			<div class="control-group">
				<label class="control-label" for="oldPassword" >班级名</label>
				<div class="controls">
					<input type="text"  id="insertName" placeholder="班级名">
				</div>
			</div>
			<div class="control-group">
				<label class="control-label" for="Password">教师名</label>
				<div class="controls">
					<input type="text" id="insertTeacher" placeholder="教师名">
				</div>
			</div>
			<div class="control-group">
				<label class="control-label" for="inputPassword">课程代码</label>
				<div class="controls">
					<select id="insertCocourseCode" class="courseName">
						<c:forEach var="coName" items="${courseName}">
							<option value=${coName.cocourseCode}>${coName.coname}</option>
						</c:forEach>
					</select>
				</div>
			</div>
		</form>
  </div>
  <div class="modal-footer">
    <button class="btn" data-dismiss="modal" aria-hidden="true">关闭</button>
    <button class="btn btn-primary" id="insertClass_btn">Save changes</button>
  </div>
</div>